package grape.wx.rest.mp.user.mvc;

import com.baomidou.mybatisplus.core.metadata.IPage;
import grape.common.rest.advice.DisableGRB;
import grape.common.rest.advice.DisableGRM;
import grape.common.rest.mvc.BaseController;
import grape.common.rest.mvc.SuperController;
import grape.wx.rest.mp.user.form.MpUserListPageForm;
import grape.wx.rest.mp.user.mapper.MpUserWebMapper;
import grape.wx.rest.mp.user.vo.MpUserVo;
import grape.wx.service.mp.user.api.IMpUserService;
import grape.wx.service.mp.user.po.MpUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

/**
 * <p>
 * 公众号微信用户 前端控制器
 * </p>
 *
 * @author yangwei
 * @since 2020-07-27
 */
@RestController
@RequestMapping("/wx/mpuser")
@ApiIgnore
public class MpUserInnerController extends SuperController {

    @Autowired
    private MpUserWebMapper currentWebMapper;
    @Autowired
    private IMpUserService currentService;


    @DisableGRM
    @DisableGRB
    @GetMapping("/inner/trans/support")
    public boolean support(String type){
        return currentService.support(type);
    }
    @DisableGRM
    @DisableGRB
    @GetMapping("/inner/trans")
    public String trans(String type,String key){
        return currentService.trans(type,key);
    }


    @GetMapping("/inner/getByOpenidAndAppCode")
     @ResponseStatus(HttpStatus.OK)
     public MpUser getByOpenidAndAppCode(String openId,String appCode) {
         return currentService.getByOpenidAndAppCode(openId, appCode);
     }
    @GetMapping("/inner/getById")
    @ResponseStatus(HttpStatus.OK)
    public MpUser getById(String id) {
        return currentService.getById(id);
    }
}
